home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / jdsaver / config.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-09-13  |  7.4 KB  |  222 lines

  1. VERSION 4.00
  2. Begin VB.Form Configuration 
  3.    Caption         =   "Jim & Don's Screensaver Setup"
  4.    ClientHeight    =   4176
  5.    ClientLeft      =   4620
  6.    ClientTop       =   2424
  7.    ClientWidth     =   3648
  8.    Height          =   4500
  9.    Icon            =   "Config.frx":0000
  10.    Left            =   4572
  11.    LinkTopic       =   "Form2"
  12.    ScaleHeight     =   4176
  13.    ScaleWidth      =   3648
  14.    Top             =   2148
  15.    Width           =   3744
  16.    Begin VB.PictureBox Picture2 
  17.       Appearance      =   0  'Flat
  18.       AutoRedraw      =   -1  'True
  19.       AutoSize        =   -1  'True
  20.       BackColor       =   &H80000005&
  21.       BorderStyle     =   0  'None
  22.       ForeColor       =   &H80000008&
  23.       Height          =   2088
  24.       Index           =   0
  25.       Left            =   4000
  26.       Picture         =   "Config.frx":030A
  27.       ScaleHeight     =   174
  28.       ScaleMode       =   3  'Pixel
  29.       ScaleWidth      =   189
  30.       TabIndex        =   9
  31.       Top             =   45
  32.       Visible         =   0   'False
  33.       Width           =   2268
  34.    End
  35.    Begin VB.PictureBox Picture2 
  36.       Appearance      =   0  'Flat
  37.       AutoRedraw      =   -1  'True
  38.       AutoSize        =   -1  'True
  39.       BackColor       =   &H80000005&
  40.       BorderStyle     =   0  'None
  41.       ForeColor       =   &H80000008&
  42.       Height          =   2088
  43.       Index           =   1
  44.       Left            =   4000
  45.       Picture         =   "Config.frx":44CC
  46.       ScaleHeight     =   174
  47.       ScaleMode       =   3  'Pixel
  48.       ScaleWidth      =   189
  49.       TabIndex        =   8
  50.       Top             =   -15
  51.       Visible         =   0   'False
  52.       Width           =   2268
  53.    End
  54.    Begin VB.PictureBox Picture2 
  55.       Appearance      =   0  'Flat
  56.       AutoRedraw      =   -1  'True
  57.       AutoSize        =   -1  'True
  58.       BorderStyle     =   0  'None
  59.       ForeColor       =   &H80000008&
  60.       Height          =   2172
  61.       Index           =   2
  62.       Left            =   4000
  63.       ScaleHeight     =   181
  64.       ScaleMode       =   3  'Pixel
  65.       ScaleWidth      =   199
  66.       TabIndex        =   7
  67.       Top             =   1020
  68.       Visible         =   0   'False
  69.       Width           =   2388
  70.    End
  71.    Begin VB.PictureBox Picture1 
  72.       Appearance      =   0  'Flat
  73.       BackColor       =   &H80000005&
  74.       ForeColor       =   &H80000008&
  75.       Height          =   1356
  76.       Left            =   900
  77.       ScaleHeight     =   1332
  78.       ScaleWidth      =   1824
  79.       TabIndex        =   6
  80.       Top             =   324
  81.       Width           =   1848
  82.    End
  83.    Begin VB.Timer Timer1 
  84.       Interval        =   400
  85.       Left            =   3204
  86.       Top             =   3468
  87.    End
  88.    Begin VB.CommandButton CmdCancel 
  89.       Caption         =   "&Cancel"
  90.       Height          =   432
  91.       Left            =   1944
  92.       TabIndex        =   5
  93.       Top             =   3552
  94.       Width           =   1200
  95.    End
  96.    Begin VB.CommandButton CmdOK 
  97.       Caption         =   "&OK"
  98.       Height          =   432
  99.       Left            =   492
  100.       TabIndex        =   4
  101.       Top             =   3552
  102.       Width           =   1200
  103.    End
  104.    Begin VB.Image Image1 
  105.       Height          =   2175
  106.       Left            =   675
  107.       Top             =   105
  108.       Width           =   2385
  109.    End
  110.    Begin VB.Label Label1 
  111.       Alignment       =   2  'Center
  112.       Caption         =   "Large"
  113.       Height          =   255
  114.       Index           =   2
  115.       Left            =   2595
  116.       TabIndex        =   3
  117.       Top             =   2745
  118.       Width           =   930
  119.    End
  120.    Begin VB.Label Label1 
  121.       Alignment       =   2  'Center
  122.       Caption         =   "Small"
  123.       Height          =   252
  124.       Index           =   1
  125.       Left            =   216
  126.       TabIndex        =   2
  127.       Top             =   2760
  128.       Width           =   936
  129.    End
  130.    Begin VB.Label Label1 
  131.       Alignment       =   2  'Center
  132.       Caption         =   "Size of Circles"
  133.       Height          =   252
  134.       Index           =   0
  135.       Left            =   1092
  136.       TabIndex        =   1
  137.       Top             =   2424
  138.       Width           =   1596
  139.    End
  140.    Begin ComctlLib.Slider Slider1 
  141.       Height          =   315
  142.       Left            =   615
  143.       TabIndex        =   0
  144.       Top             =   3000
  145.       Width           =   2385
  146.       _Version        =   65536
  147.       _ExtentX        =   4212
  148.       _ExtentY        =   550
  149.       _StockProps     =   64
  150.       LargeChange     =   1
  151.       Max             =   9
  152.       Min             =   1
  153.       SelStart        =   5
  154.       Value           =   5
  155.    End
  156. Attribute VB_Name = "Configuration"
  157. Attribute VB_Creatable = False
  158. Attribute VB_Exposed = False
  159. 'For information about this program see the declarations
  160. 'section of the JDSaver.BAS module.
  161. 'This form is used to configure the program, and is called
  162. 'from Sub Main when the program is started with
  163. 'the /c command parameter
  164. Option Explicit
  165. Private Sub CmdCancel_Click()
  166.     'Exit without saving any changes
  167.     Unload Me
  168. End Sub
  169. Private Sub CmdOK_Click()
  170.     'This will save the current Circle size to
  171.     'HKEY_CURRENT_USER\Software\VB and VBA Program Settings
  172.     'in the registry.
  173.     SaveSetting "Samples", "JD Screen Saver", "Size", Size
  174.     Unload Me
  175. End Sub
  176. Private Sub Form_Load()
  177.     Dim nRet As Long
  178.     'Make this form a TOPMOST window, so it won't get lost under
  179.     'the Display Properties window.
  180.     'tempLong = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  181.     'Adjust the form height for resolution dependency.
  182.     Height = Picture2(0).Height * 2
  183.     '-----------------------------
  184.     'Build the monitor image
  185.     '-----------------------------
  186.     'Set the final picture box to match the size of the
  187.     'ones containing the picture elements
  188.     Picture2(2).Move Picture2(0).Left, Picture2(0).Top, Picture2(0).Width, Picture2(0).Height
  189.     nRet = BitBlt(Picture2(2).hDC, 0&, 0&, Picture2(2).ScaleWidth, Picture2(2).ScaleHeight, Picture2(1).hDC, 0&, 0&, SRCAND)
  190.     nRet = BitBlt(Picture2(2).hDC, 0&, 0&, Picture2(2).ScaleWidth, Picture2(2).ScaleHeight, Picture2(0).hDC, 0&, 0&, SRCINVERT)
  191.     'Move the picture to the actual image display,
  192.     'center it on the screen, and put the output in
  193.     'position.
  194.     Image1.Picture = Picture2(2).Image
  195.     Image1.Move (Width - Image1.Width) / 2, Image1.Top, Image1.Width, Picture2(0).Height
  196.     Picture1.Move Image1.Left + 18 * xPixel, Image1.Top + 18 * yPixel, 153 * xPixel, 114 * yPixel
  197.     'Align other form elements vertically
  198.     label1(0).Top = Image1.Top + Image1.Height + 8 * yPixel
  199.     label1(1).Top = label1(0).Top + label1(0).Height
  200.     label1(2).Top = label1(1).Top
  201.     Slider1.Top = label1(1).Top + label1(1).Height
  202.     CmdOK.Top = Slider1.Top + Slider1.Height + 10 * yPixel
  203.     CmdCancel.Top = CmdOK.Top
  204.     'Copy a clone of the desktop into the picture box, to
  205.     'serve as a background for the preview
  206.     CopyScreen Picture1
  207.     Centerform Me
  208.     'Set the slider to the circle size.
  209.     Slider1.value = Size
  210. End Sub
  211. Private Sub Slider1_Scroll()
  212.   'Size is a Public variable, used in the drawing routine
  213.   Size = Slider1.value
  214.   'Start drawing again, using the new value
  215.   Picture1.Cls
  216. End Sub
  217. Private Sub Timer1_Timer()
  218.     'Call the circle drawing routine, with output
  219.     'to this form's picture box.
  220.     Draw Picture1
  221. End Sub
  222.